/*
 * GenericDAO.java
 *
 * Created on 23 de Junho de 2007, 01:29
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package br.unifor.finance.persistence.dao;

import br.unifor.finance.common.dto.PersistentObject;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Cleilson
 */
public interface GenericDAO<E extends PersistentObject, K> {
  
  public K insert(E object) throws GenericDAOException;
  
  public void update(E entityObject) throws GenericDAOException;
  
  public void delete(E entityObject) throws GenericDAOException;
  
  public List<E> findAllList(Class<? extends E> entityObjectClass) throws GenericDAOException;
  
  public Map<K, E> findAllMap(Class<? extends E> entityObjectClass) throws GenericDAOException;
  
  public E findById(Class<? extends E> entityObjectClass, K key) throws GenericDAOException;
  
  public List<E> findList(String namedQueryKey, Map<String, ? extends Object> params) throws GenericDAOException;
  
  public Map<K, E> findMap(String namedQueryKey, Map<String, ? extends Object> params) throws GenericDAOException;
  
  public List<E> findList(Class<? extends E> entityObjectClass, String attributeName, Object atributeValue) throws GenericDAOException;
  
  public Map<K, E> findMap(Class<? extends E> entityObjectClass, String attributeName, Object attributeValue) throws GenericDAOException;
  
}
